import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/cupertino.dart' hide Action;

import 'action.dart';
import 'state.dart';

Effect<TextEditState> buildEffect() {
  return combineEffects(<Object, Effect<TextEditState>>{
    TextEditAction.onSubmit: _onSubmit,
  });
}

void _onSubmit(Action action, Context<TextEditState> ctx) async {
  String content = ctx.state.contentEditController.text;
  Navigator.of(ctx.context).pop(content);
}
